
import 'package:get/get.dart';
import 'package:wechat_manager/network/network_helper.dart';
import 'package:wechat_manager/pages/content/draft/draft_state.dart';
import 'package:wechat_manager/utils/log_util.dart';

class DraftController extends GetxController {

  DraftState state = DraftState();

  @override
  void onReady() {
    getBatchDraft();
  }

  void getBatchDraft() {
    var params = {
        "offset": 0,
        "count": 10,
        "no_content": 1
    };
    NetworkHelper.INSTANCE.contentService.getBatchDraft(params).then((res){
      if(res.errcode == null) {
        state.articleItems.value = res.items ?? [];
      }
    });
  }
}